<!--SIF Implementation Specification 2.2-6 (March 17, 2008)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.sifinfo.org/infrastructure/2.x" xmlns:sif="http://www.sifinfo.org/infrastructure/2.x" elementFormDefault="qualified">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="imports/xml/xml.xsd" />
  <xs:complexType name="StudentPeriodAttendanceType">
    <xs:annotation>
      <xs:documentation>
								This object provides attendance for a student in the context of a SectionInfo object.
								This object is used by all agents in a zone that provide period attendance,
								but don't have the logic to determine whether or not they have sufficient rights to override attendance from another user or system.
								Agents that represent a system that can validate attendance based on, among other things, its source, should subscribe to
								StudentPeriodAttendance events to collect "suggested" attendance changes from the zone,
								and should then publish "accepted" attendance changes as OfficialStudentPeriodAttendance events.
								A rejected change would result in an event that reverts the system that generated the rejected event back to its previous state
								or to some other state that represents the correct "official" attendance.
							</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="TimetablePeriod" minOccurs="0" nillable="true" type="xs:normalizedString">
        <xs:annotation>
          <xs:documentation>The period within which attendance is being reported, e.g. "4D".  Conditional on the SectionInfo object having MeetingTime elements.  If one or more are defined for the Section, this element is required.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TimeIn" minOccurs="0" nillable="true" type="xs:time">
        <xs:annotation>
          <xs:documentation>The time the student entered or returned to this class.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="TimeOut" minOccurs="0" nillable="true" type="xs:time">
        <xs:annotation>
          <xs:documentation>The time the student left this class.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="AttendanceCode">
        <xs:annotation>
          <xs:documentation>The local attendance code.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
          <xs:simpleContent>
            <xs:extension base="xs:token">
              <xs:attribute name="AttendanceCodeInfoRefId" use="required" type="sif:IdRefType" />
            </xs:extension>
          </xs:simpleContent>
        </xs:complexType>
      </xs:element>
      <xs:element name="AuditInfo">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="CreationUser">
              <xs:complexType>
                <xs:sequence>
                  <xs:element name="UserId" type="xs:normalizedString">
                    <xs:annotation>
                      <xs:documentation>Unique identifier of the user that created the attendance record.  This will depend on the user and the source.  The preferred identifier would be a RefId for a StaffPersonal, StudentContact, or StudentPersonal Object.  However, the user may not be associated with any of these SIF objects.  In that case a unique ID given by the source should be used.</xs:documentation>
                    </xs:annotation>
                  </xs:element>
                </xs:sequence>
                <xs:attribute name="Type" use="required">
                  <xs:annotation>
                    <xs:documentation>The role of the staff member for that created this attendance record.</xs:documentation>
                  </xs:annotation>
                  <xs:simpleType>
                    <xs:restriction base="xs:token">
                      <xs:enumeration value="Office Staff" />
                      <xs:enumeration value="School Admin" />
                      <xs:enumeration value="Parent" />
                      <xs:enumeration value="Nurse" />
                      <xs:enumeration value="Teacher" />
                      <xs:enumeration value="Other" />
                    </xs:restriction>
                  </xs:simpleType>
                </xs:attribute>
              </xs:complexType>
            </xs:element>
            <xs:element name="CreationDateTime" type="xs:dateTime">
              <xs:annotation>
                <xs:documentation>The date and time of this attendance record was created.</xs:documentation>
              </xs:annotation>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="AttendanceComment" minOccurs="0" nillable="true" type="xs:string">
        <xs:annotation>
          <xs:documentation>This element contains the comments that are relevant to this attendance record.</xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="SIF_Metadata" minOccurs="0" nillable="true" type="sif:SIF_MetadataType" />
      <xs:element name="SIF_ExtendedElements" minOccurs="0" nillable="true" type="sif:SIF_ExtendedElementsType" />
    </xs:sequence>
    <xs:attribute name="RefId" use="required" type="sif:RefIdType" />
    <xs:attribute name="StudentPersonalRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The GUID of the student that this attendance applies to.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="SectionInfoRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The GUID of the section that this attendance applies to.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="SchoolInfoRefId" use="required" type="sif:IdRefType">
      <xs:annotation>
        <xs:documentation>The school where the attendance was recorded.  Somewhat redundant, needed for requests.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
    <xs:attribute name="Date" use="required" type="xs:date">
      <xs:annotation>
        <xs:documentation>The date of the attendance event.</xs:documentation>
      </xs:annotation>
    </xs:attribute>
  </xs:complexType>

  <xs:element name="StudentPeriodAttendance" type="sif:StudentPeriodAttendanceType" />

</xs:schema>